<template>
  <ConfigProvider :locale="getAntdLocale" :theme="themeConfig">
    <AppProvider>
      <RouterView />

    </AppProvider>
  </ConfigProvider>
</template>

<script lang="ts" setup>
import { AppProvider } from '@/components/Application';
import { useTitle } from '@/hooks/web/useTitle';
import { useLocale } from '@/locales/useLocale';
import { ConfigProvider } from 'ant-design-vue';
import { userinfo } from '@/api/com';
import { useDarkModeTheme } from '@/hooks/setting/useDarkModeTheme';
import 'dayjs/locale/zh-cn';
import { computed } from 'vue';
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
import { getToken } from '@/utils/auth';
// support Multi-language
const { getAntdLocale } = useLocale();

const { isDark, darkTheme } = useDarkModeTheme();

const themeConfig = computed(() =>
  Object.assign(
    {
      token: {
        colorPrimary: '#0960bd',
        colorSuccess: '#55D187',
        colorWarning: '#EFBD47',
        colorError: '#ED6F6F',
        colorInfo: '#0960bd',
      },
    },
    isDark.value ? darkTheme : {},
  ),
);
if (getToken()) {
  userinfo().then((res) => {
    userStore.setUserInfo(res.data);
  });
}
// Listening to page changes and dynamically changing site titles
useTitle();
</script>
<style>
.video_container {
  display: flex;
  position: absolute;
  flex-wrap: wrap;
}

.leaflet-popup-tip-container {
  display: none;
}

.tag_info_tooltip {
  font-size: 12px;
}

.merberCount {
  width: 30px;
  height: 20px;
  transform: translate(-50%,-50%);
  border: 1px solid #808184;
  opacity: 0.5;
  background-color: #fafbfe;
  color: #000;
  font-size: 12px;
  font-weight: 100;
  line-height: 20px;
  text-align: center
}
</style>
